import request from '@/utils/request'

// 查询微信二维码列表
export function listWechatQrcode(query) {
  return request({
    url: '/wechat/qrcode/list',
    method: 'get',
    params: query
  })
}

// 生成新的微信二维码
export function generateWechatQrcode(data) {
  return request({
    url: '/wechat/qrcode/generate',
    method: 'post',
    data: data
  })
}

// 查询微信二维码详情
export function getWechatQrcode(id) {
  return request({
    url: '/wechat/qrcode/' + id,
    method: 'get'
  })
}

// 新增微信二维码
export function addWechatQrcode(data) {
  return request({
    url: '/wechat/qrcode',
    method: 'post',
    data: data
  })
}

// 修改微信二维码
export function updateWechatQrcode(data) {
  return request({
    url: '/wechat/qrcode',
    method: 'put',
    data: data
  })
}

// 删除微信二维码
export function delWechatQrcode(id) {
  return request({
    url: '/wechat/qrcode/' + id,
    method: 'delete'
  })
}

// 下载微信二维码
export function downloadWechatQrcode(id) {
  return request({
    url: '/wechat/qrcode/download/' + id,
    method: 'get',
    responseType: 'blob'
  })
}
